//
//  SNUpdateClass.h
//  project
//
//  Created by 黄建华 on 2017/12/30.
//  Copyright © 2017年 黄建华. All rights reserved.
//

#import <Foundation/Foundation.h>
#define SN_Net           ([SNUpdateClass sharedInstance])
#define LASTUPDATESTEP   [NSString stringWithFormat:@"LASTUPDATESTEP:%d",SN_USER.user_id]
#define LASTUPDATESLEEP  [NSString stringWithFormat:@"LASTUPDATESLEEP:%d",SN_USER.user_id]
#define LASTUPDATEHEART  [NSString stringWithFormat:@"LASTUPDATEHEART:%d",SN_USER.user_id]
#define LASTUPDATEBP     [NSString stringWithFormat:@"LASTUPDATEBP:%d",SN_USER.user_id]
#define LASTUPDATEOX     [NSString stringWithFormat:@"LASTUPDATEOX:%d",SN_USER.user_id]

typedef enum {
    HJUpdateStep  = 0,
    HJUpdateSleep = 1,
    HJUpdateHeart = 2,
    HJUpdateOX    = 3,
    HJUpdateBp    = 4,
    HJUpdateMap   = 5,
} HJUpdateModelUpdateState;

typedef enum {
    GetEquipmentInfo  = 0,
    RemoveEquipment   = 1,
} GetOrRemoveEquipmentInfoState;

typedef void(^ReloadHomePageFoodViewBlock)(BOOL isSupportFood);

@interface SNUpdateClass : NSObject
@property(nonatomic, assign) NSInteger save;
@property(nonatomic, strong) NSString *app_id;
@property(nonatomic, copy) ReloadHomePageFoodViewBlock block;
AS_SINGLETON(SNUpdateClass)

// 登录
- (void)loginOnWithsuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 游客登录 //第三方登录接口
- (void)loginOnWithOpenId :(NSString*)openId withOpenType:(NSString *)openType Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 获取用户信息 token
- (void)getUserInfoWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//上传图片
-(void)uploadImageWithImage:(UIImage *)image WithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 上传用户信息
- (void)updateUserInfoWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 注册手机
- (void)RegistratWithPhonesuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 注册邮箱
- (void)RegistratWithEmailsuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 获取用户是否设置了密保
- (void)getEmailSecretsuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 通过密保重新设置密码
- (void)setEmailSecretsuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//用户信息反馈
-(void)FeedBackWithContent:(NSString *)content Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 上传 数据 运动 睡眠 心率 血氧 血压
- (void)updateEveryModelWithType:(HJUpdateModelUpdateState)type;
// 根据类型上传数据
- (void)uploadDataToServer:(HJUpdateModelUpdateState)link dict:(NSDictionary *)dict
                   success:(NSObjectSimpleBlock)success
                      fail:(NSObjectSimpleBlock)fail;
//上传跑道数据
- (void)uploadDataToServer:(NSString *)link dict:(NSDictionary *)dict image:(UIImage *)image imageName:(NSString *)imageName
                   success:(NSObjectSimpleBlock)success
                      fail:(NSObjectSimpleBlock)fail;
//获取跑道数据
-(void)getTrackDataWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 获取设备在线信息
- (void)getDeviceSFromServerWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 获取设备升级信息
- (void)getDeviceUpdateInfoFromServerWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//同步数据
- (void)updateDataWithType:(HJUpdateModelUpdateState)type;
//获取所有APP版本状态
-(void)getAppUpdateInfoFromServerWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//上传用户手环信息
- (void)updateBleDevice:(GetOrRemoveEquipmentInfoState)type Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;

//获取天气接口
- (void)getWeatherWith:(NSDictionary *)dic Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//发送用户日志
-(void)uploadUserLog;
-(void)feedBackUserLog;
//设置用户所属的app_id
- (void)updateUserAppid:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
/***********************************下载数据***********************************/
//备注:系统信息 0时区  好友请求0时区+当前时区
/********************************好友功能接口********************/
// 查找用户 要查找的邮箱/手机号/ID
- (void)friendWithSearch:(NSString *)searchInfo success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//下载头像
- (void)downImageHeardWith;

//*************************添加好友*************************
// 用户主页 用户ID
- (void)friendWithSearchHomePage:(NSString *)userId success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//邀请好友
- (void)friendWithInvitation:(NSString *)userId success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;

//*************************好友请求*************************
//好友邀请信息列表
- (void)friendGetInvitationSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 同意
- (void)friendPassInvitation:(NSString *)userId Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 拒绝
- (void)friendRejectInvitation:(NSString *)userId Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 删除好友请求
- (void)friendDeleteInvitation:(NSString *)userId Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//*************************我的好友*************************
// 好友列表
- (void)friendGetListSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 删除好友
- (void)friendDeleteFriend:(NSString *)userId Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 备注好友
- (void)friendRemarkFriend:(NSString *)userId Remark:(NSString*)string Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//*************************系统消息*************************
//获取未读消息数量
- (void)friendSystemNoReadSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//消息全部标记为已读
- (void)friendSystemAllReadSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 用户消息列表/页码
- (void)friendGetSystemWithPage:(NSInteger)page Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//*************************好友健康*************************
-  (void)friendClickWithType:(NSInteger)type userid:(NSString*)userid Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//*************************用户信息*************************
// 上传用户统计数据
- (void)friendUploadDataSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
// 获取用户数据接口的数据在用户主页star对象一样
- (void)friendGetDataWithUserid:(NSString*)userid Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
//*************************健康食谱*************************

// 匹配食物 返回匹配的食材字典(数组)
- (void)FoodSearchWithFoodName:(NSString *)foodName Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;

// 新增用餐
- (void)FoodAddWithFoodModel:(FoodEatModel *)model Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;

// 编辑用餐
- (void)FoodEditWithFoodModel:(FoodEatModel *)model Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;

// 删除用餐
- (void)FoodDeleteWithFoodModel:(FoodEatModel *)model Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;

// 获取当日食谱 
- (void)foodListSearchWithDate:(NSString *)dateString Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;

// 开始日期-
- (void)foodListSearchWithStateDate:(NSString *)startDateString Success:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;

- (void)showHUD:(NSString*)info withTime:(CGFloat)time;

//2019 1 15 好友排名接口
// 步数分布统计
- (void)sortGetStepWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
- (void)sortGetSleepTimeWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
- (void)sortGetSleepStartTimeWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;
- (void)checkNetSuccess:(NSObjectSimpleBlock)successBlock;

// 2019.2.25 防丢后台接口

// 2019.06.19获取天猫精灵的用户码
- (void)getCodeWithSuccess:(NSObjectSimpleBlock)success fail:(NSObjectSimpleBlock)fail;

@end

